﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>不使用正则验证IP地址</title>
    <script type="text/javascript" language="JavaScript">
        function isip(s){
            try{
                return (v<=25 && v >=0);
            }catch(x){
                return false;
            }
            let res = s.split(".");
            return (re.length === 4)?(check(re[0]) && check(re[1]) && check(re[2]) && check(re[3])):false;
        }
        let s="202.168.54.215";
        alert(isip(s));
    </script>
</head>
<body>

</body>
</html>